<?php 

			require '../include/library.inc.php';
	

			$tmp = 'home';
			if(!$_REQUEST["prm1"]) $tmp = 'home';
			
			if($_REQUEST["prm1"]) $tmp = $_REQUEST["prm1"];
			
			if($_REQUEST["prm1"])
			{
				
				
				$sql = "SELECT catalog_id 
						FROM catalog
						WHERE sef_url = '".escape($_REQUEST["prm2"])."'  AND published";
			
				  
				if($result = query($sql) && $_REQUEST["prm2"]) $tmp = 'product';
				
				 $sef_url = escape($_REQUEST["prm2"]);
				
				/*$sql = "SELECT page_id 
						FROM pages
						WHERE sef_url = '".escape($_REQUEST["prm1"])."'  AND published";
			
				
				if($result = query($sql) && !file_exists( './tamplates/'.escape($_REQUEST["prm1"]).'.tmp.php' )) 
				{
				$tmp = 'page';
				$sef_url = escape($_REQUEST["prm1"]);
				}
			*/
			}
			
			if(!file_exists( './tamplates/'.$tmp.'.tmp.php' )) $tmp = 'home';
			
			//$sef_url = 'about-us';
			
			if($_REQUEST["prm"]) $sef_url = $_REQUEST["prm"];
			
			//echo $_REQUEST["tmp"];
			//echo '<br />'.$tmp;
			require 'tamplates/'.$tmp.'.tmp.php';
		
		
?>


